/**
 * kl yy-ds @2021
 */
package com.cxps.cloud.base;

import com.cxps.cloud.enums.DataStatus;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 数据基础对象
 *
 * @author YouCai.Liu
 * @since 2021/10/8
 * ...
 */
@Data
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    // 数据的创建人创建时间
    private String createBy;
    private Date createTime;

    // 数据的修改人修改时间
    private String updateBy;
    private Date updateTime;

    // 数据状态：00线下   50线上
    private String status;

    public void preInsert() {
        this.createBy = "1";
        this.createTime = new Date();
        this.updateBy = "1";
        this.updateTime = new Date();
        this.status = DataStatus.ON_LINE.getCode();
    }

    public void preUpdate() {
        this.updateBy = "1";
        this.updateTime = new Date();
    }

}
